#include "RrcMessageTypes.h"

RrcSystemInformationBlockType1::RrcSystemInformationBlockType1():
freqBandIndicator_(0),
systemInfoValueTag_(0),
plmnId_(0),
isTddConfigPresent_(false)
{
}

const RrcSystemInformationBlockType3* RrcSystemInformation::getForRead(
        TypeSelector<RrcSystemInformationBlockType3>) const
{
    return &sib3_;
}

const RrcSystemInformationBlockType4* RrcSystemInformation::getForRead(
        TypeSelector<RrcSystemInformationBlockType4>) const
{
    return &sib4_;
}

const RrcSystemInformationBlockType5* RrcSystemInformation::getForRead(
        TypeSelector<RrcSystemInformationBlockType5>) const
{
    return &sib5_;
}

RrcSystemInformationBlockType3* RrcSystemInformation::getForWrite(
        TypeSelector<RrcSystemInformationBlockType3>)
{
    RrcSystemInformationBlockType3* p = NULL;
    // Make sure that Sib hasn't been added to the message before
    if ((MAX_SI > numOfSib_) && 
            (false == isSibAddedInMessage_[SIB3_CHOSEN]))
    {
        p = &sib3_;
        choice_[numOfSib_] = SIB3_CHOSEN;
        isSibAddedInMessage_[SIB3_CHOSEN] = true;
        ++numOfSib_;
    }
    return p;
}

RrcSystemInformationBlockType4* RrcSystemInformation::getForWrite(
        TypeSelector<RrcSystemInformationBlockType4>)
{
    RrcSystemInformationBlockType4* p = NULL;
    // Make sure that Sib hasn't been added to the message before
    if ((MAX_SI > numOfSib_) && 
            (false == isSibAddedInMessage_[SIB4_CHOSEN]))
    {
        p = &sib4_;
        choice_[numOfSib_] = SIB4_CHOSEN;
        isSibAddedInMessage_[SIB4_CHOSEN] = true;
        ++numOfSib_;
    }
    return p;
}

RrcSystemInformationBlockType5* RrcSystemInformation::getForWrite(
        TypeSelector<RrcSystemInformationBlockType5>)
{
    RrcSystemInformationBlockType5* p = NULL;
    // Make sure that Sib hasn't been added to the message before
    if ((MAX_SI > numOfSib_) && 
            (false == isSibAddedInMessage_[SIB5_CHOSEN]))
    {
        p = &sib5_;
        choice_[numOfSib_] = SIB5_CHOSEN;
        isSibAddedInMessage_[SIB5_CHOSEN] = true;
        ++numOfSib_;
    }
    return p;
}

RrcSystemInformationBlockType5::RrcSystemInformationBlockType5()
{
}

QHystSF::QHystSF():
hystSFMedium_(NUM_OF_HYST_SF),
hystSFhigh_(NUM_OF_HYST_SF)
{
}

